import request from '@/router/axios';
/**
 * 新建分组post 修改分组put
 */
export function addAndEditMediumGroup(obj, method) {
    return request({
        url: '/cp/mediumgroup',
        method: method,
        data: obj
    });
}
/**
 * 删除分组
 */
export function delMediumGroup(id) {
    return request({
        url: `/cp/mediumgroup/${id}`,
        method: 'delete'
    });
}
/**
 * 话术库分组列表
 */
export function getMediumGroup(query) {
    return request({
        url: '/cp/mediumgroup',
        method: 'get',
        params: query
    });
}
/**
 * 话术库列表
 */
export function materialLibraryList(query) {
    return request({
        url: '/cp/medium/page',
        method: 'get',
        params: query
    });
}
/**
 * 新建话术库素材
 */
export function addMaterialLibrary(obj) {
    return request({
        url: '/cp/medium',
        method: 'post',
        data: obj
    });
}
/**
 * 删除话术素材
 */
export function delMaterialLibrary(id) {
    return request({
        url: `/cp/medium/${id}`,
        method: 'delete'
    });
}
/**
 * 修改话术库素材
 */
export function editMaterialLibrary(obj) {
    return request({
        url: '/cp/medium',
        method: 'put',
        data: obj
    });
}
//文件上传
export function upload(obj) {
    return request({
        url: '/cp/common/upload',
        method: 'post',
        data: obj,
        headers: {
            // responseType: 'blob',
            'content-type': 'multipart/form-data'
            // 'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq'
        }
    });
}
//根据链接回显图片
export function showImg(query) {
    return request({
        url: '/cp/medium/parse-link-article',
        method: 'get',
        params: query
    });
}
//根据部门id获取分组列表
export function queryMediumGroupList(query) {
    return request({
        url: '/cp/mediumgroup/dept',
        method: 'get',
        params: query
    });
}
// 修改分组name
export function editGruopItemName(query) {
    return request({
        url: '/cp/mediumgroup/group-name',
        method: 'put',
        params: query
    });
}
